using System;
using System.Collections.Generic;
using System.Text;

namespace tKitchen
{
    public class Ingredient
    {
        int ingredientId;
        string name;
        string descr;
        IngredientCategory category;

        #region Properties
        public int IngredientId
        {
            get { return ingredientId; }
            set { ingredientId = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public string Descr
        {
            get { return descr; }
            set { descr = value; }
        }

        public IngredientCategory Category
        {
            get { return category; }
            set { category = value; }
        }


        #endregion

        public Ingredient()
        {
        }
        public Ingredient(IngredientPO objPOIn)
        {
            this.ingredientId = objPOIn.IngredientId;
            this.name = objPOIn.Name;
            this.descr = objPOIn.Descr;
            //this.Category = objPOIn.Category;

        }
        public Ingredient(int idIn, string nameIn, string descIn, IngredientCategory catIn)
        {
            ingredientId = idIn;
            name = nameIn;
            descr = descIn;
            category = catIn;
        }

        public override string ToString()
        {
            return this.name;
        }

        internal Ingredient Copy()
        {
            Ingredient temp = new Ingredient();
            if (this.category != null)
            {
                temp.Category = this.Category.Copy();
            }
            temp.Descr = this.Descr;
            temp.IngredientId = this.IngredientId;
            temp.Name = this.Name;

            return temp;
        }
    }
}
